package de.mhus.lib.mandala.functions;

import de.mhus.lib.mandala.Function;
import de.mhus.lib.mandala.Response;
import de.mhus.lib.mandala.Sphere;
import de.mhus.lib.mandala.UiUtil;

public class FunctionCall extends Sphere {

	private Function function;
	private Object[] attributes;

	public FunctionCall() {}
	
	public FunctionCall(Function function, Object ... attributes) {
		this.function = function;
		this.attributes = attributes;
	}

	@Override
	protected void doRender(Response out) {
		function.renderElementName(out);
		out.print("(");
		UiUtil.renderAsGetter(attributes, getParent(), out);
		out.print(")");
	}
}
